function SuperType(name) {	
	this.name = name;	
	this.colors = ["red","green","black"];
}; 
SuperType.prototype.sayName = function() {
	return this.name
}; 
function SubType(name, age) {	
	SuperType.call(this, name);	//继承一次
	this.age = age;
}; 

// let superType01 = new SuperType("卢本伟")
// let subType01 = new SubType("卢本伟", 18)

/* 普通组合继承 */
// SubType.prototype = new SuperType();	//继承第二次

/* 组合寄生 */
function inherit(son,father){
    // 步骤一
	let tmpObj = Object.create(father.prototype)	//不发生第二次继承
    console.log(tmpObj)
    
    // 步骤二
	tmpObj.constructor =  son
    
    // 步骤三
	son.prototype = tmpObj
}
inherit(SubType,SuperType)

SubType.prototype.sayAge = function () {return this.age};

let superType02 = new SuperType("伞兵一号")
let subType02 = new SubType("伞兵一号", 18)


// https://blog.csdn.net/qq_41996454/article/details/108634046